
<?php
/**
 * Template Name: Profile 
 * Description: Profile Page
 *
 * @package WordPress
 * @subpackage Immersion
 * @since Immersion 1.0
 
 */
get_header(  ); 

$hostname_CrossFit = "localhost";
$database_CrossFit = "quadnips_CF26AppsDev";
$username_CrossFit = "quadnips_26";
$password_CrossFit = "fearless";
$CrossFit = mysql_pconnect($hostname_CrossFit, $username_CrossFit, $password_CrossFit) or trigger_error(mysql_error(),E_USER_ERROR); 

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_MemberProfile = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_MemberProfile = $_SESSION['MM_Username'];
}
mysql_select_db($database_CrossFit, $CrossFit);
$query_MemberProfile = sprintf("SELECT * FROM Members WHERE Email = %s", GetSQLValueString($colname_MemberProfile, "text"));
$MemberProfile = mysql_query($query_MemberProfile, $CrossFit) or die(mysql_error());
$row_MemberProfile = mysql_fetch_assoc($MemberProfile);
$totalRows_MemberProfile = mysql_num_rows($MemberProfile);
 


 ?>
<div id="primary" class="full-width">
        

			<div id="content" role="main">

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header class="entry-header">
		<?php do_action( 'gpp_before_title' ); ?>
		<h1 class="entry-title"><?php the_title(); ?></h1>
			
	</header><!-- .entry-header -->
    <div class="entry-content">
			<p><a href="http://development.crossfit26.com/app/profile/edit-profile/">Edit Profile</a></p>
<table width="600" border="0">
  <tr>
    <td><label for="Name1">Name </label></td>
    <td><?php echo $row_MemberProfile['Name']; ?></td>
  </tr>
  <tr>
    <td><label for="Email">Email Address</label></td>
    <td><?php echo $row_MemberProfile['Email']; ?></td>
  </tr>
  <tr>
    <td><label for="MembershipType">Membership Type </label></td>
    <td><?php echo $row_MemberProfile['Membership_Type']; ?></td>
  </tr>
  <tr>
    <td><label for="Address">Address </label></td>
    <td><?php echo $row_MemberProfile['Address']; ?></td>
  </tr>
  <tr>
    <td><label for="City">City </label></td>
    <td><?php echo $row_MemberProfile['City']; ?></td>
  </tr>
  <tr>
    <td><label for="State">State </label></td>
    <td><?php echo $row_MemberProfile['State']; ?></td>
  </tr>
  <tr>
    <td><label for="Zip">Zip Code</label></td>
    <td><?php echo $row_MemberProfile['Zip']; ?></td>
  </tr>
  <tr>
    <td><label for="Phone">Phone Number </label></td>
    <td><?php echo $row_MemberProfile['Phone']; ?></td>
  </tr>
  <tr>
    <td><label for="EmergencyContact">Emergency Contact </label></td>
    <td><?php echo $row_MemberProfile['Emergency_Contact']; ?></td>
  </tr>
  <tr>
    <td><label for="EmergencyContactPhone">Emergency Contact Phone </label></td>
    <td><?php echo $row_MemberProfile['Emergency_Contact_Phone']; ?></td>
  </tr>
  
</table></p>
	</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->

			</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); 

mysql_free_result($MemberProfile);
?>
